<?php
/**
 * Created by PhpStorm.
 * User: 26243
 * Date: 2017/5/6
 * Time: 19:12
 */
require_once("../include.php");
    $arr=$_POST;
    $arr['password']=md5($_POST['password']);
    $arr['regTime']=time();
$arr['face']=time();
    //var_dump($arr);
global $link;
$keys = "".join(",", array_keys($arr));
$vals = "'" . join("','", array_values($arr)) . "'";
$sql = "INSERT INTO imooc_user({$keys}) VALUES ({$vals})";
$result=mysqli_query($link, $sql);
//	print_r($arr);exit;
    if($result){
        $mes="注册成功!<br/>3秒钟后跳转到登陆页面!<meta http-equiv='refresh' content='3;url=index.php'/>";
    }else{

        $mes="注册失败!<br/><a href='zc.php'>重新注册</a>|<a href='index.php'>查看首页</a>";
    }
    echo $mes;
